package cn.edu.haust.Mqdemo.controller;

import cn.edu.haust.Mqdemo.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.jms.Destination;

/**
 * Created by 17670 on 2017/9/13.
 */
@Controller
@RequestMapping("/test")
public class TestController {

    @RequestMapping
    public String home(){
        return "index";
    }

    @RequestMapping("/user")
    @ResponseBody
    public User test(@RequestBody User user){
        if (user!=null){
            System.out.println(user.getName()+"---"+user.getAge()+"---"+user.getGender());
        }
        return user;
    }

}
